import { takeEvery, put } from 'redux-saga/effects'
import { GET_MY_LIST } from './actionTypes'
import { getListAction } from './actionCreators';
import axios from 'axios'

function* mySaga() {
    yield takeEvery(GET_MY_LIST, getList)
}

function* getList() {
    // console.log('jspang');
    const res = yield axios.get('https://www.easy-mock.com/mock/5a31238a7ea45c08a5db77c6/example/getList');
    const action = getListAction(res.data);
    yield put(action);
}

export default mySaga;